package com.ojoin.trade.t0loan_core.web.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ojoin.trade.common.exception.BusinessException;
import com.ojoin.trade.common.web.dao.BaseDao;
import com.ojoin.trade.common.web.service.impl.BaseServiceImpl;
import com.ojoin.trade.t0loan_core.web.dao.TbT0RefundTaskDao;
import com.ojoin.trade.t0loan_core.web.domain.TbT0RefundTask;
import com.ojoin.trade.t0loan_core.web.domain.TbT0RefundTaskVO;
import com.ojoin.trade.t0loan_core.web.service.TbT0RefundTaskService;

@Service
public class TbT0RefundTaskServiceImpl extends
		BaseServiceImpl<TbT0RefundTask> implements
		TbT0RefundTaskService {
	@Autowired
	private TbT0RefundTaskDao dao;

	@Override
	protected BaseDao<TbT0RefundTask> getBaseDao() {
		return dao; 
	}

	@Override
	public List<TbT0RefundTaskVO> queryAllUserUnsuccessRefundTask()
			throws BusinessException {
		return ((TbT0RefundTaskDao) this.getBaseDao()).queryAllUserUnsuccessRefundTask();
	}

	@Override
	public TbT0RefundTaskVO queryUserLastRefundTaskById(int joinuserid)
			throws BusinessException {
		return ((TbT0RefundTaskDao) this.getBaseDao()).queryUserLastRefundTaskById(joinuserid);
	}

	@Override
	public int insertT0RefundTask(TbT0RefundTask vo) throws BusinessException {
		return ((TbT0RefundTaskDao) this.getBaseDao()).insert(vo);
	}
	
	public int updateRefundTaskStatusAndMemoById(int id, int status, String memo, String orderid) throws BusinessException {
		return ((TbT0RefundTaskDao) this.getBaseDao()).updateRefundTaskStatusAndMemoById(id, status, memo, orderid);
	}
}
